<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 利用for循环输出1 - 100 岁
    for (let i = 1; i <= 100; i++) {
      document.write(i + '岁 <br>')
    }

    // 求1 - 100之间所有的偶数和
    let sum = 0
    for (let i = 1; i <= 100; i++) {
      if (i % 2 === 0) {
        sum += i;
      }
    }
    document.write(sum + ' <br>')

    // 页面中打印5个小星星
    for (let i = 1; i <= 5; i++) {
      document.write('⭐ <br>')
    }

    // 遍历数组 ['A', 'B', 'C', 'D', 'E']
    let arr = ['A', 'B', 'C', 'D', 'E']
    for (let i = 0; i < arr.length; i++) {
      console.log(arr[i])
    }
  </script>
</body>

</html>